import traceback
class UserException(Exception):
    pass

def login(username,password):
    if username!='admin':
        raise UserException('用户名不存在')
    if password!='123':
        raise UserException('密码不正确')

try:
    a = int(input("输入a:"))
    username = input('请输入用户名:')
    password = input('请输入密码:')
    login(username,password)
    print(f'欢迎{username}登录我们的系统!')
except UserException as e:
    print(e)
    traceback.print_exc()
else:
    #没有抛出异常会执行这个代码
    print("登录验证通过!")
finally:
    print("哈哈哈，结束了")

print("正常结束")